<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{ title }}</text>
		</view>
		<u-button class="but" text="月落" type="primary" @click="toXzqh"></u-button>
		<u-button class="but" text="月落2" type="primary" @click="toTest"></u-button>
		<text style="margin-top: 20rpx;" class="title">{{ $cache.get('username') || '...' }}</text>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				ip: "http://183.162.219.15:8009/",
				token: "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImZhOTNiYTllLWEzYjUtNGIxZi1hODdlLTJhYjFjODI3ZWIxZSJ9.je43Jky2qP7vXF6J5P3iEvZMb0Jl7pkV-k0Hcw1coun1LHEm-7MVtCPpazumee046jO6_6V_ENqaWBpNKUkURA"
			};
		},
		onLoad() {
			uni.setStorageSync("ip", this.ip)
			uni.setStorageSync("token", this.token)

			setTimeout(() => {
				this.$cache.set('username', '张三');
			}, 2000)
		},
		onShow() {
			if (this.$route.query.value) {
				this.title = this.$route.query.value
			}
		},
		methods: {
			toXzqh() {
				uni.navigateTo({
					url: '/components/xzqh-select/index',
				});
			},
			toTest() {
				uni.navigateTo({
					url: '/pages/test1/index',
				});
			},
		},
	};
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 0 20rpx;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}

	.but {
		margin-top: 20rpx;
	}
</style>